/**
 * @namespace
 */
var Antiquity = {};
/**
 * Provide basic support for event driven programming.
 * @author yaoxing zhang
 * @class Base class for event driven model.
 * @constructor
 * @memberOf Antiquity
 */
Antiquity.EventDriven = function() {
	this.events = {};
};
Antiquity.EventDriven.prototype = {
	events: null,
	/**
	 * Observe a certain event.
	 * @param {String} eventName Event name. The event name must follow JavaScript property naming rule.
	 * @param {Function} handler The function that would be invoked when the event fires.
	 */
	observe: function(eventName, handler) {
		if (!this.events[eventName]) {
			this.events[eventName] = [];
		}
		this.events[eventName].push(handler);
	},
	/**
	 * Fire a certain event
	 * @param {String} eventName Event name.
	 * @param {Array} params Parameters that you want to send to event handler.
	 */
	_fire: function(eventName, params) {
		queue = this.events[eventName];
		if (queue) {
			for (var i = 0, len = queue.length; i < len; i++) {
				var handler = queue[i];
				handler.apply(this, params);
			}
		}
	}
};
/**
 * @namespace
 */
Antiquity.Bridge = {};
/**
 * @memberOf Antiquity.Bridge
 */
Antiquity.Bridge.extendObject = Object.extend;
/**
 * @memberOf Antiquity.Bridge
 */
Antiquity.Bridge.getOffsetParent = Element.getOffsetParent;
/**
 * @memberOf Antiquity.Bridge
 */
Antiquity.Bridge.observe = Event.observe;
/**
 * @memberOf Antiquity.Bridge
 */
Antiquity.Bridge.remove = Element.remove;
